<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var foo1 = 123
    var foo2 = 321
    console.log(foo1 == foo2) // false

    // ==运算符,在类型不相同的情况下,会先转化成number的值,在进行比较
    foo1 = ""
    foo2 = 0
    console.log(Number(foo1))
    console.log(Number(foo2))
    console.log(foo1 == foo2) // true

    // === 类型不相等的时候 直接返回false
    console.log(foo1 === foo2) //false

  </script>
</body>

</html>